import {createRouter, createWebHashHistory, createWebHistory, RouteRecordRaw} from 'vue-router'
const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: '首页',
        component: () => import('@/views/HomeView.vue'),
        redirect: '/index',
        children: [
            {
                path: '/index',
                name: '首页',
                component: () => import('@/views/IndexView.vue'),
            },
            {
                path: '/userCenter',
                name: '个人中心',
                component: () => import('@/views/userCenter/IndexView.vue')
            },
        ]
    },
    {
        path: '/login',
        name: '登录',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import('@/views/LoginView.vue')
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
